﻿using Com.JunCaiSoft.AutoMapper;
using Com.JunCaiSoft.ReportCenter.Model;
using Microsoft.AspNetCore.Builder;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Com.JunCaiSoft.ReportCenter
{
    public static class ReportCenterAutoMapperConfigure
    {
        public static void CreateReportCenterMapper(IApplicationBuilder app)
        {
            var creator = app.UseAutoMapper();

            #region 映射银行报表数据项
            creator.CreateMap<BankItem, BankReportItem>()
                .ForMember(dest => dest.children, opt => opt.Ignore());
            creator.CreateMap<ProjectItem, BankReportChildrenItem>();
            #endregion

            #region 映射项目报表数据项
            creator.CreateMap<ProjectInfo,ProjectReportItem>()
                .ForMember(dest => dest.children, opt => opt.Ignore());
            creator.CreateMap<BankInfo, ProjectReportChildrenItem>();
            #endregion
        }
    }
}
